<?php
	// Author: Andy Marti
	// Datum: 08.04.2014
	// ----------------------------------------------------
	// Beschreibung Klasse:
	//   Die Klasse enthält alle Eigenschaften und Methoden des 
	//   Verbandes und die Verbandskosten und Lizenzkosten. 
	//   Sie wird als Propery der Member Klasse übergeben
	//   
	// ----------------------------------------------------
	// Änderungen:
	//
	// ----------------------------------------------------
	
	require_once 'base.php';
	require_once 'constants.php';
	
	
	/**
	 * 
	 * @author Andy Marti
	 *
	 */
	class Association extends Base {
		// ------------------------------------------------
		/**
		 * Die Eigenschaften der Klasse.
		 *
		 */
		// Public Variables.
		// Private Variables.
		private $MemberID = -1;
		// Public Objects
		public  $AssociationList = NIL;

		// ------------------------------------------------
		// Public methodes.
		public function getAssociationData($memberid) {
			If ($this->checkInitial()) {
				if (empty($memberid)) {
					$this->Messages->throwMessage($this->Messages->NumWrongMemberId, '');
				}
				// Get association data from UserDB object.
				$this->UserDb->getAssociations($this, $memberid);
				// Fill internal fields.
				$this->MemberID = $memberid;
			}
		}
		
		/**
		 * 
		 * @return string:
		 */
		public function getAssociationsAsString() {
			$res = array_keys($this->AssociationList);
			return implode(', ', $res);
		}

		/**
		 *
		 * @return string:
		 */
		public function getAssociationIDsAsString() {
			foreach ($this->AssociationList as $key=>$value) {
				$res[] = $key.'-'.$value;
			}
			return implode(', ', $res);
		}
		
		//
		// ------------------------------------------------
		// Contructor, Destructor.
		/**
		 * Construtor. 
		 * 
		 */
		public function __construct(){
			// Cresate internal objects.
		}
		
		/**
		 * Destructor.
		 *
		 */
		public function __destruct(){
			// Destroy internal objects.
			
		}
	}
?>